//
//  NewLinesCollectionViewCell.m
//  OneDoller
//
//  Created by jt on 16/8/16.
//  Copyright © 2016年 jyj. All rights reserved.
//

#import "NewLinesCollectionViewCell.h"
@interface NewLinesCollectionViewCell()





@end

@implementation NewLinesCollectionViewCell

- (id) initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        //        内容的图片
        
        self.imageV = [[UIImageView alloc]initWithFrame:CGRectMake(7, 7, CGRectGetWidth(self.frame)-14, CGRectGetWidth(self.frame)-30)];
        self.imageV.backgroundColor =[UIColor groupTableViewBackgroundColor];
        [self addSubview:self.imageV];
        
        //        第多少期，多少期的内容
        
        self.productLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.imageV.frame)+5, CGRectGetWidth(self.frame)-20, 20)];
        self.productLabel.font = [UIFont boldSystemFontOfSize:18];
        self.productLabel.font = [UIFont fontWithName:@ "Arial" size:17.0];
        self.productLabel.textColor = [UIColor grayColor];
        [self addSubview:self.productLabel];
        
        //        剩余次数的进度条
        
        self.ProgressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];
        self.ProgressView.frame = CGRectMake(10, CGRectGetMaxY(self.productLabel.frame) + 5,CGRectGetWidth(self.frame)-20 ,20);
        //        设置进度条颜色
        self.ProgressView.trackTintColor = [UIColor grayColor];
        //        设置进度条上颜色
        self.ProgressView.progressTintColor = [UIColor greenColor];
        [self addSubview:self.ProgressView];
        
        //        剩余次数
        
        self.surplusNumber = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.ProgressView.frame)+5, CGRectGetWidth(self.frame)-20, 20)];
        self.surplusNumber.font = [UIFont boldSystemFontOfSize:18];
        self.surplusNumber.font = [UIFont fontWithName:@ "Arial" size:17.0];
        self.surplusNumber.textColor = [UIColor grayColor];
        [self addSubview:self.surplusNumber];
        
    }
    return self;
}
//- (id)initWithFrame:(CGRect)frame
//{
//    self = [super initWithFrame:frame];
//    if (self) {
//        // Initialization code
//        self.backgroundColor = [UIColor purpleColor];
//        
//        self.imgView = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, CGRectGetWidth(self.frame)-10, CGRectGetWidth(self.frame)-10)];
//        self.imgView.backgroundColor = [UIColor groupTableViewBackgroundColor];
//        [self addSubview:self.imgView];
//        
//        self.text = [[UILabel alloc]initWithFrame:CGRectMake(5, CGRectGetMaxY(self.imgView.frame), CGRectGetWidth(self.frame)-10, 20)];
//        self.text.backgroundColor = [UIColor brownColor];
//        self.text.textAlignment = NSTextAlignmentCenter;
//        [self addSubview:self.text];
//        
//        self.btn = [UIButton buttonWithType:UIButtonTypeCustom];
//        self.btn.frame = CGRectMake(5, CGRectGetMaxY(self.text.frame), CGRectGetWidth(self.frame)-10,30);
//        [self.btn setTitle:@"按钮" forState:UIControlStateNormal];
//        self.btn.backgroundColor = [UIColor orangeColor];
//        [self addSubview:self.btn];
//    }
//    return self;
//}
@end
